﻿using System;
using System.Web;
using System.Web.UI;

public partial class System_Controls_Common_MetaTag : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) 
        {
            SiteFox.Business.Model.Site _Site = SiteFox.Business.Manager.Site.Get();
            if (_Site.Title != "")
            {
                Page.Header.Title = _Site.Title + " - " + Page.Header.Title;
            }
            if (_Site.GenerateMeta)
            {
                string _MetaTags = "<meta name='description' content='" + _Site.Description + "'>\n\r" +
                                    "<meta name='keywords' content='" + _Site.Keywords + "'>\n\r" +
                                    "<meta name='revisit-after' content='" + _Site.ReVisit.ToString() + " Days'>\n\r" +
                                    "<meta name='Robots' content='" + _Site.RobotToDo + "'>\n\r" +
                                    "<meta name='author' content='" + _Site.Author + "'>\n\r" +
                                    "<meta name='copyright' content='" + _Site.Copyrights + "'>\n\r";
                lit_MetaTags.Text = _MetaTags;
            }
        }
    }
}